package org.eirudy.shareimage.model.enums;

import cn.hutool.core.util.ObjectUtil;
import lombok.Getter;

/**
 *  图片状态枚举类
 */
@Getter
public enum PictureReviewStatusEnum {

    REVIEWING("待审核",0),
    PASS("通过",1),
    REJECT("拒绝",2);

    private final String text;

    private final int value;

    PictureReviewStatusEnum(String text, int value) {
        this.text = text;
        this.value = value;
    }

    public static PictureReviewStatusEnum getPictureReviewStatusEnumByValue(int value) {
        if(ObjectUtil.isEmpty(value)){
            return null;
        }
        for(PictureReviewStatusEnum e : PictureReviewStatusEnum.values()) {
            if(e.value == value) {
                return e;
            }
        }
        return null;
    }
}
